package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.Order;
import com.foreknow.elmboot.po.OrderDetailet;
import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.OrderDetailetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/OrderDetailetController")
public class OrderDetailetController {
    @Autowired
    private OrderDetailetService orderDetailetService;

    @RequestMapping("/getOrderDetailetByOrderId")
    public List<OrderDetailet> getOrderDetailetByOrderId(OrderDetailet orderDetailet) throws Exception{
        return orderDetailetService.getOrderDetailetByOrderId(orderDetailet.getOrderId());
    }

    @RequestMapping("/CreateOrderDetailet")
    public int CreateOrderDetailet(OrderDetailet orderDetailet) throws Exception{
        return orderDetailetService.CreateOrderDetailet(orderDetailet);
    }
}
